package org.example.service;

import org.example.domain.dto.DTO;
import org.example.domain.dto.PageDTO;
import org.example.domain.po.ErpRole;
import com.baomidou.mybatisplus.extension.service.IService;
import org.example.domain.po.ErpUser;
import org.example.domain.query.RoleQuery;
import org.example.domain.vo.ErpRoleVO;
import org.example.domain.vo.home.HomeDataVO;
import org.example.utils.Result;

import java.util.List;
import java.util.Map;

/**
* @author DELL
* @description 针对表【erp_role(角色表)】的数据库操作Service
* @createDate 2024-10-09 17:03:06
*/
public interface ErpRoleService extends IService<ErpRole> {
    boolean insertRole(ErpRole role);
    
    PageDTO<ErpRoleVO> queryRolePage(RoleQuery query);
    
    boolean saveGrant(Map<String, Object> data);
    
    boolean updateRole(ErpRole props);
    
    List<ErpRole> findRoleByTenantId(Long tenantId);
    
    boolean updateRoleEnable(List<String> roleNames, boolean enable, Long tenantId);
    
    Result removeBatchByNames(List<String> roleNames, Long tenantId);
    
    ErpRole getRoleByUserId(Long userId);
    
    DTO<HomeDataVO> getHomeData(ErpUser user);
}
